home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc / Sample Code / SampleCode Read Me < prev   
Encoding:
Text File  |  1995-12-15  |  8.4 KB  |  122 lines  |  [TEXT/ttxt]

  1. Sample Code “Read Me”
  2. by The OpenDoc™ Sample Code Team
  3. December 15, 1995
  4.  
  5.  
  6. © 1993-1995  Apple Computer, Inc. All Rights Reserved.
  7. Apple, the Apple logo, and Macintosh are registered trademarks of Apple Computer, Inc.
  8. Mac and OpenDoc are trademarks of Apple Computer, Inc.
  9. -------------------------------------------------------------------------------------------------------------------------------------
  10.  
  11. This folder contains various sample part editors, the Container Application Library (CALib), PartMaker, and OpenDoc Scripting examples.
  12.  
  13. PartMaker 4.4
  14. PartMaker is a template part editor generator; meaning that it will create a folder hierarchy with sources and build support for a part editor. It is extremely useful for creating a working body of code from which to start your part development. Template documents are provided for the sample parts also provided on this CD.
  15.  
  16. Scripting
  17. This folder contains some useful information and template classes for developers wishing to add scripting support to their parts.
  18.  
  19. CALib & You…
  20. CALib is provided to allow standard Macintosh applications to be more easily  modified to allow embedding of OpenDoc parts.
  21.  
  22. Sample Editors/Viewers
  23. This folder contains lots of OpenDoc part development examples. The samples are updated versions of the SamplePart (in C and C++), Picture viewer, Text editor, Drawing editor, and Sound editor, and 3 new parts: Cappuccino, Panel editor, and Script Runner . Each main implementation file (in the case of SamplePart, SamplePart.cpp) details the recipes and functionality that the part demonstrates. For more detailed descriptions of the sample parts, please refer to the “About Sample Code Parts” document found in the “Sample Editors/Viewers” folder.
  24.  
  25. We hope all the samples give you a place to start and are useful in getting you started with OpenDoc part editor development.
  26.  
  27. [Please note the warnings listed at the end of this document]
  28.  
  29.  
  30. Getting Started
  31. Building any of the sample parts is easy, though you must have first set up your build environment as prescribed in the “Development” folder installation documents. Once you have your preferred build environment installed, copy the part you wish to work with to your local drive (perhaps inside your development folder).
  32.  
  33. In the MPW® environment, all samples share a single build system. The build system relies on the UserStartup•OpenDoc script to provide the necessary information for the MPW environment. For other environments, refer to the "setup" documentation provided elsewhere on the CD. In any case, the environment will need to locate the "OpenDoc" folder.
  34.  
  35. Each sample contains project sources and interfaces in a “Sources” folder, an output folder for the object files called “Objects”, an optional folder for System Object Model™ (SOM) support/source files  (named “_SOM_” in the SamplePart example), and projects, or a makefile, for supported enviornments.
  36.  
  37. To build a sample, make sure you have installed the necessary support files. To do this, open the "Development Additions" folder and follow the instructions provided.
  38.  
  39. Most Notable Changes
  40. The parameters and use of the build script has been enhanced/changed from the DR3 version. The script now requires that you specify the compilers you wish to build with differently. This done with the -b command. Also, as part of the continued "genericizing" effort, the FAT library build rules have been moved out into the build system (see SamplePart.make for the latest makefile layout). In addition, a "non debug" option has been added to produce "final" binaries (the option is -noDBG).
  41.  
  42. Makefiles for the sample parts have been enhanced to take advantage of some newer requirements and build system enhancements. All tools used in the build process are now substituted at "make time" through variables defined in the build system. The link lines now specify CFM version numbers. The source dependency rules now specify the precompiled header. The OpenDoc utilities dependency rules are part of the build system/support.
  43.  
  44. Building 68k Parts in MPW Pro
  45. To build a sample part in MPW... 
  46. 1) Launch the MPW Shell application.
  47. 2) Set the current directory to your local copy of the sample you are building.
  48.                     Directory 'Macintosh HD:MPW:SamplePart (C++):'
  49. 3) Run the build script for the sample providing one of several build options.
  50.                         BuildOpenDocPart -f ":SamplePart.make" -b SCpp
  51.  
  52. The build script supports building parts with both the Symantec 68k C++ compiler and MrC/Cpp. The build script also drives the SOM compiler, and the Rez tool for the sample parts.
  53.  
  54. The following (monaco) text outlines the scripts usage.
  55.  
  56. Usage: BuildOpenDocPart -f <makefile> -b <compiler(s)> [options]*
  57.  
  58.     <compiler(s)> = compiler<1>,…compiler<n>
  59.  
  60.         'Idl' to generate .[x]h, .[x]ih, and .c[pp] files
  61.         'PubIdl' to generate public .[x]h files
  62.         'Rez' to generate MPW and MW project .rsrc files
  63.         'SCpp' to build part with SCpp
  64.         'SC' to build part with SC
  65.         'MrCpp' to build part with MrCpp
  66.         'MrC' to build part with MrC
  67.         'SMrCpp' to build part with SMrCpp
  68.         'SMrC' to build part with SMrC
  69.  
  70. Options:
  71.     -fat              # merge the 68k and PPC shared libraries
  72.     -k                   # rebuild all source files
  73.     -noPCH            # don't compile code using precompiled headers
  74.     -noDBG            # compile with sym/macsbug options off (#define _RETAIL)
  75.     -toco <opt>    # temporarily override compiler option
  76.                     (ie. -toco "-d OptimizationOption=speed")
  77.  
  78. (Note: If you run the BuildSampleCode script with no parameters, it will provide you with the information provided above)
  79.  
  80. To adjust the individual compiler options, you merely need to locate the appropriate variable makefile in the “Build Support” folder for the compiler. Each compiler has its own variables makefile. (e.g. The Symantec™ SCpp compiler options file is named SCppVars.make).
  81.  
  82. Building PPC Parts in MPW Pro
  83. There is no difference from building parts for 68k, except that you must specify a PowerPC compiler when executing the BuildOpenDocPart script.
  84.                         BuildOpenDocPart -f ":SamplePart.make" -b MrCpp
  85.  
  86. Building PPC Parts in an Integrated Development Environment (IDE)
  87.         (eg. CodeWarrior, Symantec 8.0)
  88. To build a sample part in an IDE...
  89. 1) Launch the project for the sample.
  90. 2) If necessary, update the project so that it can locate the "Build Support" folder you previously installed.
  91. 3) Save preference changes.
  92. 4) Build the project.
  93.  
  94. If you need to make changes to a sample's IDL file, .r file, or resource (.rsrc) file, you will need to have the MPW environment installed (unless your IDE supports build those). The IDL build can only be driven from MPW using the provided build script as described above.
  95.  
  96. Using MrC/Cpp  [E.T.O./MPW Pro Subscribers ]
  97. This version of the build system supports MrC/Cpp 1.0f1 (or later) and the PPCLink 1.3 (or later) tool. See the “SamplePart.make” makefile for an example of a PPC link line supporting MrC/Cpp. Both tools will be/are available on E.T.O #18 (and later).
  98.  
  99. Note that you will need to set your MPW Shell partition to (at least) 8mb and you must have (at least) 12mb of temp mem available when you do a build. If you get really weird errors, try giving MPW more memory and/or freeing up more temp mem.
  100.  
  101. Running Built Editors
  102. Once you've built your part editor, you will obviously want to run it. For information on running and using part editors, refer to the Tech Notes in the “Documentation” folder at the root level of this CD.
  103.  
  104. Debugging Part Editors
  105. There is a worthwhile discussion on the ins/outs of debugging in the CFM runtime environment in the “Debugging OD Part Editors” in the “Debugging OpenDoc” folder.
  106.  
  107. Example Part Resources
  108. A ResEdit file of example part cursors, icons, thumbnails, and an about box has been provided for use with the parts you create. The file includes all cursors not available from the System for use with parts, a sampling of various document and editor icon suites, as well as a smattering of thumbnail samples, a generic about box, and most of the patterns needed to implement various OpenDoc specific borders/highlighting.
  109.  
  110. The resources in the file were used in creating the sample code parts.
  111.  
  112.  
  113. Have Fun!
  114. The OpenDoc Sample Code Team
  115. ----------------------------------------------------------------------------------------------------------------------------------------
  116.  
  117. Warnings:
  118.  
  119. • All builds rely on having built resource files in the PPC & 68k objects folders. If the files are destroyed or removed from those folders, be sure to run the MPW build for the sample using the -b rez option; this will regenerate the resource files for both the PPC and 68k builds.
  120.  
  121.  
  122.